$(function () {
    $("#searchCondition").focus();
    //渲染表格
    var columns = clearRuleList.columnsInit();
    var table = clearRuleList.gridInit(columns);
    var datas = clearRuleList.dataInit();
    $("#clearRuleTable").bootstrapTable("append",datas);
})
;(function(undefined) {
    "use strict"
    var _global;

    function result(args,fn){
        var argsArr = Array.prototype.slice.call(args);
        if(argsArr.length > 0){
            return argsArr.reduce(fn);
        } else {
            return 0;
        }
    }
    var clearRuleList = {
        columnsInit:function(){
            return  [{
                field: 'radio',
                radio: true,
                align: 'center',
                valign: 'middle'
            },{
                field: 'od',
                title: '序号',
                width:'8%',
                align:'center'
            }, {
                field: 'dataName',
                title: '规则名称',
            }]
        },
        gridInit:function(columns){
            return $("#clearRuleTable").bootstrapTable({
                url:'',
                columns: columns,
                striped: 'true',
                classes: 'table table-hover qxttable',
                clickToSelect: true,  //单击选中列，且复选框选中
            })

        },
        dataInit:function(){
            return  [{
                od: 1,
                dataName:'新设备的初始值',
                colName: 'DLC0001',
                colValue: 'DLC0001'
            }, {
                od: 1,
                dataName:'单位周期内达到产量的多少倍，表示异常',
                colName: 'DLC0001',
                colValue: 'DLC0001',
            },{
                od: 3,
                dataName:'数据类型',
                colName: 'DLC0001',
                colValue: 'DLC0001'
            },{
                od: 4,
                dataName:'仪表量程',
                colName: 'DLC0001',
                colValue: 'DLC0001',
            },{
                od: 5,
                dataName:'仪表量程',
                colName: 'DLC0001',
                colValue: 'DLC0001'
            },{
                od: 6,
                dataName:'仪表量程',
                colName: 'DLC0001',
                colValue: 'DLC0001',
            },{
                od: 7,
                dataName:'仪表量程',
                colName: 'DLC0001',
                colValue: 'DLC0001',
            },{
                od: 8,
                dataName:'仪表量程',
                colName: 'DLC0001',
                colValue: 'DLC0001',
            },{
                od: 9,
                dataName:'仪表量程',
                colName: 'DLC0001',
                colValue: 'DLC0001',
            },{
                od: 10,
                dataName:'仪表量程',
                colName: 'DLC0001',
                colValue: 'DLC0001',
            }]
        }
    }

    // 将插件对象暴露给全局对象
    _global = (function(){ return this || (0, eval)('this'); }());
    if (typeof module !== "undefined" && module.exports) {
        module.exports = clearRuleList;
    } else if (typeof define === "function" && define.amd) {
        define(function(){return clearRuleList;});
    } else {
        !('plugin' in _global) && (_global.clearRuleList = clearRuleList);
    }
}());